<?php
defined('IN_IA') or exit('Access Denied');
global $_W,$_GPC;

// 炮灰域名
$System = new \Controller\System();
$_system = $System->find();
if($_system["kuyuan_defend"] && !isset($_GPC["defend_jump"])) {
    $Defend = new \Kuyuan\WqCore\plug\defend\Defend();
    if($Defend->test()) {
        if($_domain = $Defend->getDomain()) {
            header("Location:".$_domain["url"]);
            exit;
        }
    }
}

if(
    $_W['container'] != 'wechat'
    ||
    $_W['os'] != 'mobile'
    ||
    strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"windowswechat") !== false
){
    message('本系统仅支持在手机微信内打开','','info');
    exit;
}

checkauth();

\Kuyuan\WqCore\util\Util::perfectNicknameAvatar();

// 网站名字
$Setting = new \Controller\Setting();
$_setting = $Setting->find();

// 注册用户
$Member = new \Controller\Member();
$Member->register();

// jsapi
$_script = \Tool\wx\Wx::jsapi();
$_script .= "<script src='https://webapi.amap.com/maps?v=1.4.15&key=".$_setting["map_key"]."&plugin=AMap.Geolocation,AMap.Geocoder'></script>";

include $this->template('mobile');